<%@page contentType="text/html"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 

<%@page import="org.adl.registry.website.ErrorHandler"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!--
* This software is licensed as open source software pursuant to the terms defined in the 
* Joint ADL Co-Lab Open Source Software License.  Use of any part of this software constitutes
* acceptance of this license. The Joint ADL Co-Lab open source agreement is available at 
* http://adlregistry.adlnet.gov/source_license.html.
-->
<%
String code = request.getParameter("c");
String message = "";

if (code == null)
{
    response.sendRedirect("/index.jsp");
}
else
{
    if (ErrorHandler.INVALID_REQUEST_101.equalsIgnoreCase(code))
    {
        message = "The retrieve request received by the ADL Regsitry website used \"multipart/form-data\" encoding. This encoding type is not supported by the website for retrieve requests.";
    }
    else if (ErrorHandler.INVALID_REQUEST_102.equalsIgnoreCase(code))
    {
        message = "The search request received by the ADL Regsitry website used \"multipart/form-data\" encoding. This encoding type is not supported by the website for search requests.";
    }
    else if (ErrorHandler.INVALID_REQUEST_103.equalsIgnoreCase(code))
    {
        message = "The ADL Registry website encountered a communication error when attempting to contact the ADL Registry.";
    }
    else if (ErrorHandler.INVALID_REQUEST_104.equalsIgnoreCase(code))
    {
        message = "The search request received by the ADL Registry website is invalid. A required parameter is either not included in the request or improperly formatted.";
    }
    else if (ErrorHandler.INVALID_REQUEST_105.equalsIgnoreCase(code))
    {
        message = "The ADL Registry website encountered a communication error when attempting to contact the ADL Registry.";
    }
    else if (ErrorHandler.INVALID_REQUEST_106.equalsIgnoreCase(code))
    {
        message = "The search request received by the ADL Registry website is invalid. A required parameter is either not included in the request or improperly formatted.";
    }
    else if (ErrorHandler.MESSAGING_ERROR_131.equalsIgnoreCase(code))
    {
        message = "The ADL Registry website was unable to complete the sending of your message. Please contact the ADL Registry support team at <a href=\"mailto:adlrhelpdesk@adlnet.gov\">adlrhelpdesk@adlnet.gov</a>.";
    }
    else if (ErrorHandler.GENERAL_ERROR_201.equalsIgnoreCase(code))
    {
        message = "The ADL Registry website was unable to find the ADL Registry search result stylesheet.";
    }
    else if (ErrorHandler.GENERAL_ERROR_202.equalsIgnoreCase(code))
    {
        message = "The ADL Registry website was unable to find the ADL Registry retrieve result stylesheet.";
    }
    else if (ErrorHandler.GENERAL_ERROR_203.equalsIgnoreCase(code))
    {
        message = "The ADL Registry website was unable to complete the transformation of the xml search result returned by the ADL Registry.";
    }
    else if (ErrorHandler.GENERAL_ERROR_204.equalsIgnoreCase(code))
    {
        message = "The ADL Registry website was unable to complete the transformation of the xml search result returned by the ADL Registry.";
    }
    else if (ErrorHandler.GENERAL_ERROR_205.equalsIgnoreCase(code))
    {
        message = "The ADL Registry website was unable to complete the transformation of the xml retrieve result returned by the ADL Registry.";
    }
    else if (ErrorHandler.GENERAL_ERROR_206.equalsIgnoreCase(code))
    {
        message = "The ADL Registry website was unable to complete the transformation of the xml retrieve result returned by the ADL Registry.";
    }
    else
    {
        response.sendRedirect("/index.jsp");
    }
}
%>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>ADL Registry</title>
        <%@ include file="/_common/document_head.jsp" %>
    </head>
    <body>
        <%@ include file="/_common/no_script.jsp" %>
        <div id="container">
            <%@ include file="/_common/header.jsp" %>
            
            <div id="nav_main">
                <ul>
                    <li id="nav_main_search"><a href="/search/index.jsp">Search</a></li>
                    <li id="nav_main_contribute"><a href="/contribute/index.jsp">Contribute</a></li>
                    <li id="nav_main_gettingstarted"><a href="/help/index.jsp">Getting Started</a></li>
                </ul>
            </div><!-- #nav_main -->
	
            <div id="nav_sub">
                <ul>
                    <li><a href="/register/index.jsp">Register Repository/Contributors</a></li>
                    <li><a href="/help/faq.jsp">FAQs</a></li>
                    <li><a href="/about/developers/index.jsp">Technical Reference</a></li>
                    <li><a href="/about/index.jsp" class="active">About ADL Registry</a></li>
                </ul>
            </div><!-- #nav_sub -->
	
            <div id="nav_breadcrumb">
                <ul>
                    <li><a href="/index.jsp">Home</a></li>
                    <li class="last">Error</li>
                </ul>
            </div><!-- #nav_breadcrumb -->
            
            <div id="content">
                <!-- Begin Page Content -->
                <center>
                    <table cellpadding="5" style="margin: 25px; margin-left: auto; margin-right: auto; width: 640px;">
                        <tr>
                            <td colspan="2">
                                <span style="font-size: 150%">The ADL Registry website has encountered an error.</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" valign="top">
                                The ADL Registry website has encountered an error and was unable to continue with your request. A brief description of the error that was encountered is displayed below. The ADL recommends that you retry the action you were attempting when the error was encountered. If you are unable to resolve this error please contact the <a href="/help/contact/index.jsp">ADL Registry Support Team</a>. Please include the error information displayed below and as much information about what you were trying to do when the error occurred as possible.
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="font-weight: bold;width:150px;">
                                Error Code: 
                            </td>
                            <td>
                                <%= code %>
                            </td>                    
                        </tr>
                        <tr>
                            <td style="font-weight: bold;width:150px;">
                                Error Description: 
                            </td>
                            <td>
                                <%= message %>
                            </td>
                        </tr>
                    </table>
                </center>
                <!-- End Page Content -->
            </div>
        </div>
        <%@ include file="/_common/footer.jsp" %>
    </body>
</html>